#define _CRT_SECURE_NO_WARNINGS 1

class Solution {
public:
    string makeSmallestPalindrome(string s) {
        int n = s.size();
        int left = 0, right = n - 1;
        while (left < right)
        {
            s[left++] = s[right--] = min(s[left], s[right]);
        }
        return s;
    }
};